package com.googlecode.continuity.plugin.svnbrowser.client;

import java.util.List;

import com.google.gwt.user.client.rpc.RemoteService;

/**
 * ReadSVNRPC
 *
 * @author Peter Schmitt <aragos@aragos.de>
 */
public interface ReadSVNRPC extends RemoteService {

  SVNRepositoryHandle connect(String url, String username, String password) throws ReadSVNException;

  /**
   * @param directoryPath
   * @return
   * @throws ReadSVNException
   * @gwt.typeArgs <com.googlecode.continuity.plugin.svnbrowser.client.wrapper.SVNDirEntryWrapper>
   */
  List getDirectoryContents(SVNRepositoryHandle handle, String directoryPath) throws ReadSVNException;

  /**
   * @param directoryPath
   * @param revision
   * @return
   * @throws ReadSVNException
   * @gwt.typeArgs <com.googlecode.continuity.plugin.svnbrowser.client.wrapper.SVNDirEntryWrapper>
   */
  List getDirectoryContents(SVNRepositoryHandle handle, String directoryPath, long revision) throws ReadSVNException;

  /**
   * @param filePath
   * @return
   * @throws ReadSVNException
   */
  String getTextFileContents(SVNRepositoryHandle handle, String filePath) throws ReadSVNException;

  /**
   * @param filePath
   * @param revision
   * @return
   * @throws ReadSVNException
   */
  String getTextFileContents(SVNRepositoryHandle handle, String filePath, long revision) throws ReadSVNException;
}
